using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class OR_OperMap : EntityTypeConfiguration<OR_Oper>
    {
        public OR_OperMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Operation)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .HasMaxLength(100);

            this.Property(t => t.Priority)
                .HasMaxLength(2);

            this.Property(t => t.Number)
                .HasMaxLength(20);

            this.Property(t => t.Notes)
                .HasMaxLength(300);

            this.Property(t => t.Status)
                .HasMaxLength(2);

            this.Property(t => t.ANA_Notes)
                .HasMaxLength(300);

            // Table & Column Mappings
            this.ToTable("OR_Oper");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Booking).HasColumnName("Booking");
            this.Property(t => t.Operation).HasColumnName("Operation");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.SurgeonIID).HasColumnName("SurgeonIID");
            this.Property(t => t.Duration).HasColumnName("Duration");
            this.Property(t => t.Priority).HasColumnName("Priority");
            this.Property(t => t.StartDate).HasColumnName("StartDate");
            this.Property(t => t.EndDate).HasColumnName("EndDate");
            this.Property(t => t.BodySite).HasColumnName("BodySite");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Notes).HasColumnName("Notes");
            this.Property(t => t.USERID).HasColumnName("USERID");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.ANA_AnaesthetistIID).HasColumnName("ANA_AnaesthetistIID");
            this.Property(t => t.ANA_Method).HasColumnName("ANA_Method");
            this.Property(t => t.ANA_ASA).HasColumnName("ANA_ASA");
            this.Property(t => t.ANA_Consultant).HasColumnName("ANA_Consultant");
            this.Property(t => t.ArrivalDate).HasColumnName("ArrivalDate");
            this.Property(t => t.DepartureDate).HasColumnName("DepartureDate");
            this.Property(t => t.ANA_StartDate).HasColumnName("ANA_StartDate");
            this.Property(t => t.ANA_EndDate).HasColumnName("ANA_EndDate");
            this.Property(t => t.ANA_intubationBlades).HasColumnName("ANA_intubationBlades");
            this.Property(t => t.ANA_IntubationRoute).HasColumnName("ANA_IntubationRoute");
            this.Property(t => t.ANA_RecoveryStartDate).HasColumnName("ANA_RecoveryStartDate");
            this.Property(t => t.ANA_RecoveryEndDate).HasColumnName("ANA_RecoveryEndDate");
            this.Property(t => t.ANA_Notes).HasColumnName("ANA_Notes");
        }
    }
}
